var anotheremaillink=0;
var SharePage = Objs("view.components.SharePage",
	UiComponent,
{   
	send:"",
    cancel:"",
	useanother:"",
	initialize: function()
	{ 
		SharePage.$super.initialize.call( this );
		this.initializeChildren();
		this.bindListeners();
		 
	},
	
    initializeChildren: function()
    {
		this.send = jQuery("#sendshare");
		this.useanother = jQuery("#useanother");		
	  
    },

	bindListeners: function()
	{
		var namespace = ".SharePage";
		this.send.on( "click"+namespace, jQuery.proxy( this, "send_clickHandler" ) );
		this.useanother.on( "change"+namespace, jQuery.proxy( this, "use_clickHandler" ) );
	},
	use_clickHandler:function()
	{ 
		if ($(jQuery("#useanother")).attr('checked')) {
		anotheremaillink=1;
			$('#anoemaildiv').show('slow');
			$('#selectdiv').hide('slow');
		}
		else
		{
		anotheremaillink=0;
			$('#anoemaildiv').hide('slow');
			$('#selectdiv').show('slow');
		}
	},
	send_clickHandler:function()
	{	
		this.dispatchEvent( SharePage.SEND );
	}
	
});
SharePage.SEND="sharesend";
